package com.kawaiior.asoulworld.property.Properties;

import net.minecraftforge.event.entity.living.LivingHurtEvent;

import java.util.Random;

public class PropertyCritical extends PropertyBase implements Iproperty {

    private float [] levelOfValue = new float[]{0.5f, 1f, 2f};

    public PropertyCritical(int level) {
        super(level);
    }

    @Override
    public void doProperty(LivingHurtEvent event) {
        if (new Random().nextBoolean()){
            event.setAmount(event.getAmount()*(1+levelOfValue[this.getLevel()]));
        }
    }

    @Override
    public String getPropertyString() {
        return "property_critical";
    }

}
